package com.magic.gre.mvp.model;

import com.magic.gre.Api;
import com.magic.gre.mvp.contract.AnswerContract;
import com.noname.lib_base_java.mvp.BaseModelImpl;
import com.noname.lib_base_java.net.RtManager;

import io.reactivex.Observable;
import io.reactivex.Observer;
import okhttp3.ResponseBody;

/**
 * Author: Lmoumou
 * Date: 2019-01-08 19:12
 * 文件名: AnswerModelImpl
 * 描述:
 */
public class AnswerModelImpl extends BaseModelImpl implements AnswerContract.Model {
    @Override
    public void mGetSubs(Observer<ResponseBody> observer, String unitId) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).getSubs(unitId);
        doHttp(observer, observable);
    }

    @Override
    public void mSumbitReslut(Observer<ResponseBody> observer, String unitId, int right, long cost_time, int total) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).submitResult(unitId, right, cost_time, total);
        doHttp(observer, observable);
    }
}
